// pages/recommend/components/list_body.js
const computedBehavior = require('miniprogram-computed').behavior
import config from '../../../config/index'
import { banners } from '../../../mock/index'

Component({
  behaviors: [computedBehavior],

  /**
   * 组件的属性列表
   */
  properties: {
    category: { // 分类数据
			type: Object,
			value: {}
		},
		load: { // 是否加载
			type: Boolean,
			value: false
		},
  },

  /**
   * 组件的初始数据
   */
  data: {
    banners: banners,
    swiperInterval: config.swiperInterval,
  },  

  /**
   * 组件的方法列表
   */
  methods: {
    onBannerUpdate(event) {
      const { index } = event.currentTarget.dataset
      wx.navigateTo({
        url: '/pages/recommend/update_banner',
      })
    }
  }
})
